//
//  ModelCollectionCell.m
//  YinHang
//
//  Created by 张亚哲 on 14/10/27.
//  Copyright (c) 2014年 孙彦鹏. All rights reserved.
//

#import "ModelCollectionCell.h"

@implementation ModelCollectionCell

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
           // 初始化时加载collectionCell.xib文件
            NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"ModelChoice" owner:self options:nil];
            // 如果路径不存在，return nil
            if (arrayOfViews.count < 1)
                {
                        return nil;
                    }
            // 如果xib中view不属于UICollectionViewCell类，return nil
            if (![[arrayOfViews objectAtIndex:0] isKindOfClass:[UICollectionViewCell class]])
                {
                    return nil;
                }
            // 加载nib
            self = [arrayOfViews objectAtIndex:0];
            }// Initialization code

    return self;

}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    // Drawing code
}
*/

@end
